<?php

return [
    'server' => [
        'swConfig' => [
            'pid_file'              => runtime_path() . 'service.pid',
            'log_file'              => runtime_path() . 'service.log',
            'daemonize'             => false,
            'reactor_num'           => swoole_cpu_num(),
            'worker_num'            => swoole_cpu_num(),
            'task_worker_num'       => swoole_cpu_num(),
            'package_max_length'    => 20 * 1024 * 1024,
            'buffer_output_size'    => 10 * 1024 * 1024,
            'socket_buffer_size'    => 128 * 1024 * 1024,
            'ssl_cert_file'         => '/usr/local/webserver/ssl/server.crt',
            'ssl_key_file'          => '/usr/local/webserver/ssl/server.key',
            'open_http2_protocol'   => true,
            'http_compression'      => false,
        ],
        'websocket' => [
            'enable' => true,
            'ping_interval' => 25000,
            'ping_timeout'  => 60000,
            'room' => [
                'cache' => 'table',
                'redis-cache' => 'redis', // redis 缓存配置
                'fields' => [
                    [ 'name' => 'fds', 'type' => \Swoole\Table::TYPE_STRING ],
                    [ 'name' => 'name', 'type' => \Swoole\Table::TYPE_STRING ]
                ]
            ]
        ],
        // websocket default event
        'event' => \iflow\swoole\implement\Server\WebSocket\Event\Events::class,
        'Handle' => '',
        'host' => [
            'host' => '127.0.0.1',
            'port' => 8081,
        ]
    ],
    'client' => [
        'swConfig' => [
            'pid_file'              => runtime_path() . 'tcp-client.pid',
            'log_file'              => runtime_path() . 'tcp-client.log',
            'daemonize'             => false,
            'reactor_num'           => swoole_cpu_num(),
            'worker_num'            => swoole_cpu_num(),
            'task_worker_num'       => swoole_cpu_num(),
            'enable_static_handler' => true,
            'package_max_length'    => 20 * 1024 * 1024,
            'buffer_output_size'    => 10 * 1024 * 1024,
            'socket_buffer_size'    => 128 * 1024 * 1024
        ],
        'host' => [
            'host' => '127.0.0.1',
            'port' => 8098,
            'timeout' => 0.5
        ],
        'Handle' => ''
    ]
];